#include <iostream>
#include <cstring>
using namespace std;
const int N=110;
int n,h; 
int p[N],c[N];
int f[N][N];
int main()
{
	cin>>n>>h;
	for(int i=1;i<=n;i++)
	{
		cin>>p[i]>>c[i];
	}
	memset(f,0x3f,sizeof f);

	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=h;j++)
		{
			f[i][j]=f[i-1][j];
			f[i][j]=min(f[i][j],f[i][max(0,j-p[i])]+c[i]);
		}
	}
	cout<<f[n][h];
	return 0;
}
